const express = require('express');
let app = express();
let cors = require('cors'); //引入跨域
require('./database/db'); //链接数据库

// 解析json
app.use(express.json());
app.use(express.urlencoded({
	extended: true,
	limit: '50mb'
}));
app.use(cors()) //解决跨域
//2 引入ejs
const ejs = require('ejs');
// 设置ejs模板
app.set('view engine', 'ejs');
// 设置静态资源
app.use(express.static('public'))

app.use('/admin', require('./routes/user'))

app.listen(3000, () => {
	console.log('3000 is runding');
})
